<?php
class LoggedIn
{
    /**
     * Store the allowed permissions
     *
     * @var array
     */
    private $_permissions;
    /**
     * Set the access permissions
     *
     * @return void
     * @param array $permissions
     */
    public function setPermissions($permissions)
    {
        $this->_permissions = $permissions;
    }
    /**
     * Check if the user is allowed access
     *
     * @return bool
     */
    public function check()
    {
        $isAllowed = FALSE;
        $userId = 0;
        if(!empty($_SESSION['user'])) {
            $userId = intval($_SESSION['user']);
        }
        if (!empty($userId)) {
            $isAllowed = TRUE;
        }
        return $isAllowed;
    }
    public function message()
    {
        $thisPage = $_SERVER['PHP_SELF'];
        echo <<< EOT
            <ul id="forfuneraldirectors" style="width:960px;height:100px;">
                <li>
                    <center>
                        <div style="position:relative;top:-5px;">You must be logged in to view this page!</div>
                        <br />
                        <div style="position:relative;top:10px;"><a href="/member.php?return=$thisPage">Login here</a></div>
                    </center>
                </li>
            </ul>

EOT;
    }
}
?>